package javacafe.serviceimple;

import java.util.List;

import javacafe.dao.VoteDAO;
import javacafe.daoimpl.VoteDAOImple;
import javacafe.dto.vote.VoteDTO;
import javacafe.dto.vote.VotePlayDTO;
import javacafe.service.VoteService;


public class VoteServiceImple implements VoteService {
	
	private VoteDAO voteDAO;
	private static VoteServiceImple voteService;
	
	private VoteServiceImple() {		
		voteDAO = new VoteDAOImple();
	}
	
	public static VoteServiceImple getInstance(){
		if (voteService==null) {
			voteService=new VoteServiceImple();
		}
		return voteService;
	}

	public void setVoteDAO(VoteDAO voteDAO) {
		this.voteDAO = voteDAO;
	}
		
	@Override
	public VoteDTO getVote(VoteDTO dto) {
		
		return voteDAO.getVote(dto);
	}

	@Override
	public List<VoteDTO> getVoteList() {
		
		return voteDAO.getVoteList();
	}

	@Override
	public boolean updateVote(VoteDTO dto) {
		
		return voteDAO.updateVote(dto);
	}

	@Override
	public boolean updateVotePlay(VotePlayDTO dto) {
		
		return voteDAO.updateVotePlay(dto);
	}

	@Override
	public boolean insertVotePlay(VotePlayDTO dto) {
		
		return voteDAO.insertVotePlay(dto);
	}

	@Override
	public VotePlayDTO getVotePlay(VotePlayDTO dto) {
		
		return voteDAO.getVotePlay(dto);
	}

	@Override
	public boolean insertVote(VoteDTO dto) {
		
		return voteDAO.insertVote(dto);
	}

	@Override
	public boolean deleteVote(VoteDTO dto) {
		
		return voteDAO.deleteVote(dto);
	}

	@Override
	public boolean deleteVotePlay(VotePlayDTO dto) {
		
		return voteDAO.deleteVotePlay(dto);
	}
	
}
